#include <stdio.h>
#include <getopt.h>


static const struct option OPTIONS[] = {
    { "input", required_argument, NULL, 'i' },
    { "output", required_argument, NULL, 'o' },
    { "help", no_argument, NULL, 'h' },
    { "version", no_argument, NULL, 'v' },
    { NULL, 0, NULL, 0 },
};

int main( int argc, char *argv[] )
{
    int arg;
    while ((arg = getopt_long(argc, argv, "", OPTIONS, NULL)) != -1) {
        switch (arg) {
            case 'h': printf("-h option\n"); break;
            case 'v': printf("-v option\n"); break;
            case 'o': printf("-o option\n"); break;
            case 'i': printf("input file is %s\n", optarg); break;
            case '?':
                      printf("Invalid command argument\n");
                      continue;
        }
    }

    return 0;
}
